/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306
 Source Server Type    : MySQL
 Source Server Version : 80028
 Source Host           : localhost:3306
 Source Schema         : book

 Target Server Type    : MySQL
 Target Server Version : 80028
 File Encoding         : 65001

 Date: 15/05/2022 17:28:17
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_book
-- ----------------------------
DROP TABLE IF EXISTS `t_book`;
CREATE TABLE `t_book` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `price` decimal(11,2) DEFAULT NULL,
  `author` varchar(100) DEFAULT NULL,
  `sales` int DEFAULT NULL,
  `stock` int DEFAULT NULL,
  `img_path` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_book
-- ----------------------------
BEGIN;
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (1, 'java 从入门到放弃', 80.00, '国哥', 10009, 16, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (2, '数据结构与算法', 78.50, '严敏君', 16, 3, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (3, '怎样拐跑别人的媳妇', 68.00, '龙伍', 100004, 47, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (4, '木虚肉盖饭', 16.00, '小胖', 53, 46, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (5, 'C++编程思想', 45.50, '刚哥', 14, 95, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (6, '蛋炒饭', 9.90, '周星星', 12, 53, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (7, '赌神', 66.50, '龙伍', 125, 535, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (8, 'Java 编程思想', 99.50, '阳哥', 47, 36, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (9, 'JavaScript 从入门到精通', 9.90, '婷姐', 85, 95, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (10, 'cocos2d-x 游戏编程入门', 49.00, '国哥', 52, 62, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (11, 'C 语言程序设计', 28.00, '谭浩强', 53, 73, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (12, 'Lua 语言程序设计', 51.50, '雷丰阳', 48, 82, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (13, '西游记', 12.00, '罗贯中', 19, 9999, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (14, '水浒传', 33.05, '华仔', 22, 88, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (15, '操作系统原理', 133.05, '刘优', 122, 188, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (16, '数据结构 java 版', 173.15, '封大神', 21, 81, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (17, 'UNIX 高级环境编程', 99.15, '乐天', 210, 810, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (19, '大话设计模式', 89.15, '国哥', 20, 10, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (20, '人月神话', 88.15, '刚哥', 21, 79, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (29, '时间简史', 30.00, '霍金', 201, 299, 'static/img/default.jpg');
INSERT INTO `t_book` (`id`, `name`, `price`, `author`, `sales`, `stock`, `img_path`) VALUES (67, '1', 1.00, '1', 1, 1, 'static/img/default.jpg');
COMMIT;

-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order` (
  `order_id` varchar(50) NOT NULL,
  `create_time` datetime DEFAULT NULL,
  `price` decimal(11,2) DEFAULT NULL,
  `status` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  PRIMARY KEY (`order_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `t_order_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_order_item
-- ----------------------------
DROP TABLE IF EXISTS `t_order_item`;
CREATE TABLE `t_order_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `count` int DEFAULT NULL,
  `price` decimal(11,2) DEFAULT NULL,
  `total_price` decimal(11,2) DEFAULT NULL,
  `order_id` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  CONSTRAINT `t_order_item_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `t_order` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_order_item
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `password` varchar(32) NOT NULL,
  `email` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (1, 'admin', 'admin', 'admin@atguigu.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (2, 'wzg168', '123456', 'wzg168@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (3, 'bbj168', '666666', 'bbj168@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (4, 'abc168', '666666', 'abc168@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (5, 'wzg16833', '123456', 'wzg168@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (9, 'wzjwzjwzj', '520520', 'wzlwzl@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (12, 'gglllgg1', '123456', '12441123@qq.com');
INSERT INTO `t_user` (`id`, `username`, `password`, `email`) VALUES (16, 'lmylmy', '123456', 'lmylmy@qq.com');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
